﻿using FluentNHibernate.Cfg;
using NH.Data.Configs;
using NH.Data.Mappings;
using NHibernate.Cfg;
using NHibernate.Dialect;
using NHibernate.Driver;

namespace Tests.Infrastructure
{
    public class SqliteConfig : DBConfig<SQLiteDialect, SQLite20Driver>
    {
        public SqliteConfig(string connection)
            : base(connection)
        {
        }

        public override Configuration GetConfig()
        {
            config = base.GetConfig();

            config = Fluently.Configure(config)
                             .Mappings(c => c.FluentMappings
                                 .AddFromAssemblyOf<ProductMap>()
                                 .Conventions.AddFromAssemblyOf<ProductMap>())
                             .BuildConfiguration();

            return config;
        }
    }
}